package net.lesscoding.rpc.message;

import lombok.Data;
import lombok.ToString;
import net.lesscoding.message.Message;

/**
 * @author eleven
 * @date 2024/12/4 8:22
 * @apiNote
 */
@Data
@ToString(callSuper = true)
public class RpcRequestMessage extends Message {
    @Override
    public int getMessageType() {
        return Message.RPC_MESSAGE_TYPE_REQUEST;
    }

    private String interfaceName;

    private String methodName;

    private Class<?> returnType;

    private Class[] paramsType;

    private Object[] params;

    public RpcRequestMessage(int seq, String interfaceName, String methodName, Class<?> returnType, Class[] paramsType, Object[] params) {
        super.setSequenceId(seq);
        this.interfaceName = interfaceName;
        this.methodName = methodName;
        this.returnType = returnType;
        this.paramsType = paramsType;
        this.params = params;
    }
}
